package com.nimitz.maintenance.service.impl;

import com.nimitz.common.core.domain.entity.SysUser;
import com.nimitz.maintenance.domain.Maintenance;
import com.nimitz.maintenance.domain.MaintenanceResult;
import com.nimitz.maintenance.mapper.MaintenanceMapper;
import com.nimitz.maintenance.service.MaintenanceService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class MaintenanceServiceImpl implements MaintenanceService {
    @Autowired
    private MaintenanceMapper maintenanceMapper;

    @Override
    public List<Maintenance> selectAll(Long kahunaId,String state) {
        List<Maintenance> maintenances = maintenanceMapper.selectAll(kahunaId,state);
        return maintenances;
    }

    @Override
    public void addMaintenance(Maintenance maintenance) {
        maintenanceMapper.addMaintenance(maintenance);
    }

    @Override
    public void updateMaintenance(Maintenance maintenance) {
        maintenanceMapper.updateMaintenance(maintenance);
    }

    @Override
    public Maintenance selectMaintenance(Long id) {
        Maintenance maintenance = maintenanceMapper.selectMaintenance(id);
        return maintenance;
    }

    @Override
    public void deleteMaintenance(Long id) {
        maintenanceMapper.deleteMaintenance(id);
    }

    @Override
    public List<SysUser> selectByRoleId() {
        List<SysUser> list = maintenanceMapper.selectByRoleId();
        return list;
    }
}
